home *** CD-ROM | disk | FTP | other *** search
/ Shareware Super Platinum 8 / Shareware Super Platinum 8.iso / mac / PROGTOOL / PASSDK30.ZIP;1 / DISK1.ZIP / PAS / PCM / RECFILA.ASM < prev    next >
Encoding:
Assembly Source File  |  1993-03-24  |  4.9 KB  |  212 lines

  1. ;$Author:   DCODY  $
  2. ;$Date:   24 Mar 1993 10:54:46  $
  3. ;$Header:   X:/sccs/pcmapps/recfila.asv   1.6   24 Mar 1993 10:54:46   DCODY  $
  4. ;$Log:   X:/sccs/pcmapps/recfila.asv  $
  5. ;  
  6. ;     Rev 1.6   24 Mar 1993 10:54:46   DCODY
  7. ;  removed common.inc as an include
  8. ;  
  9. ;     Rev 1.5   26 Jan 1993 16:38:38   DCODY
  10. ;  changed the segment declarations so tiny model is handled correctly.
  11. ;  
  12. ;     Rev 1.4   08 Dec 1992 16:41:56   DCODY
  13. ;  moved externADDR macro for Borland linker
  14. ;  
  15. ;     Rev 1.3   13 Nov 1992 18:31:18   DCODY
  16. ;  added code to make sure the active mixer (input vs output) was restored
  17. ;  correctly for the left and right side.
  18. ;  
  19. ;     Rev 1.2   17 Jul 1992 14:25:40   DCODY
  20. ;  TurnItOn will only execute if TurnItOff was first called.
  21. ;  
  22. ;     Rev 1.1   23 Jun 1992 16:09:22   DCODY
  23. ;  No change.
  24. ;  
  25. ;     Rev 1.0   15 Jun 1992 09:26:46   BCRANE
  26. ;  Initial revision.
  27. ;$Logfile:   X:/sccs/pcmapps/recfila.asv  $
  28. ;$Modtimes$
  29. ;$Revision:   1.6  $
  30. ;$Workfile:   recfila.asm  $ 
  31.  
  32.     Title    recfila.asm  --  Miscellaneous assembler code for recfile.c
  33.         page    64,131
  34.  
  35. ;   /*\
  36. ;---|*|------------====< RECFILA.ASM >====------------
  37. ;---|*|
  38. ;---|*| Copyright (c) 1991, Media Vision, Inc. All rights reserved
  39. ;---|*|
  40. ;   \*/
  41.  
  42.     .xlist
  43.     include model.inc
  44.     include masm.inc
  45.     include binary.inc
  46.     .list
  47.  
  48. PCMCODEVERSION    equ    0003h        ; version 00.03
  49.  
  50.     externADDR  MVInitMixerCode,FFAR    ; set mixer function call
  51.  
  52.  
  53. ;
  54. ;---------------------------========================---------------------------
  55. ;---------------------------====< DATA SECTION >====---------------------------
  56. ;---------------------------========================---------------------------
  57. ;
  58. if MODELSIZE eq 0
  59.     .code
  60.     assume ds:@code
  61. else
  62.     .data
  63.     assume ds:@data
  64. endif
  65.  
  66. ;
  67. ; Global Data Declarations
  68. ;
  69.     public    RightInputChannel
  70. RightInputChannel    dw    -1    ; PCm right channel
  71. RightInputMixer     db    0
  72.  
  73.         public  LeftInputChannel
  74. LeftInputChannel    dw    -1    ; PCM left channel
  75. LeftInputMixer        db    0
  76.  
  77.     extrn    MVSetMixerFunction:dword    ; set mixer function call
  78.     extrn    MVGetMixerFunction:dword    ; get mixer function call
  79.  
  80. ;
  81. ;---------------------------========================---------------------------
  82. ;---------------------------====< CODE SECTION >====---------------------------
  83. ;---------------------------========================---------------------------
  84. ;
  85.         .code
  86.  
  87.  
  88. ;   /*\
  89. ;---|*|
  90. ;---|*|------------====< TurnItOff >====----------------
  91. ;---|*|
  92. ;---|*| Turn off the PCM Input Mixer channels. This avoids feedback.
  93. ;---|*|
  94. ;---|*| Entry Conditions:
  95. ;---|*|     None
  96. ;---|*|
  97. ;---|*| Exit Conditions:
  98. ;---|*|     None
  99. ;---|*|
  100. ;   \*/
  101.  
  102.     public    TurnItOff
  103. TurnItOff    proc
  104.     push    bp
  105.     mov    bp,sp
  106. ;
  107. ; initialize the mixer code.
  108. ;
  109.     sub    ax,ax            ; send a zero path
  110.     push    ax
  111.   if @datasize
  112.         push    ax
  113.   endif
  114.     call    MVInitMixercode
  115.     mov    sp,bp
  116. ;
  117. ; Save each setting, then turn off the PCM channels to kill feed back
  118. ;
  119.     mov    cx,BI_INPUTMIXER    ; get the input mixer setting
  120.     mov    [LeftInputMixer],cl
  121.     mov    dx,BI_L_PCM
  122.     call    dword ptr [MVGetMixerFunction]
  123.         mov     LeftInputChannel,bx
  124.  
  125.         or      bh,bh                   ; is this the active channel?
  126.     jnz    @F            ; yes, continue on...
  127.  
  128.     mov    cx,BI_OUTPUTMIXER    ; get the output mixer setting
  129.     mov    [LeftInputMixer],cl
  130.     mov    dx,BI_L_PCM
  131.     call    dword ptr [MVGetMixerFunction]
  132.         mov     LeftInputChannel,bx
  133. ;
  134. @@:
  135.     mov    cx,BI_INPUTMIXER    ; get the input mixer setting
  136.         mov     [RightInputMixer],cl
  137.     mov    dx,BI_R_PCM
  138.     call    dword ptr [MVGetMixerFunction]
  139.     mov    RightInputChannel,bx
  140.  
  141.     or    bh,bh            ; is this the active channel?
  142.     jnz    @F            ; yes, continue on...
  143.  
  144.     mov    cx,BI_OUTPUTMIXER    ; get the output mixer setting
  145.         mov     [RightInputMixer],cl
  146.     mov    dx,BI_R_PCM
  147.     call    dword ptr [MVGetMixerFunction]
  148.     mov    RightInputChannel,bx
  149. ;
  150. @@:
  151.     mov    cl,[RightInputMixer]
  152.     sub    bx,bx
  153.     call    dword ptr [MVSetMixerFunction]
  154.  
  155.     mov    cl,[LeftInputMixer]
  156.     mov    dx,BI_L_PCM
  157.     call    dword ptr [MVSetMixerFunction]
  158.  
  159.     pop    bp
  160.     ret
  161.  
  162. TurnItOff    endp
  163.  
  164. ;
  165. ;   /*\
  166. ;---|*|------------====< TurnItOn() >====------------
  167. ;---|*|
  168. ;---|*| Restore the mixer settings for the PCM left/right channels
  169. ;---|*|
  170. ;---|*| Entry Conditions:
  171. ;---|*|     None
  172. ;---|*|
  173. ;---|*| Exit Conditions:
  174. ;---|*|     None
  175. ;---|*|
  176. ;   \*/
  177.  
  178.         public  TurnItOn
  179. TurnItOn        proc
  180. ;
  181. ; if we didn't set the channels, then don't restore them!
  182. ;
  183.     cmp    [RightInputChannel],-1    ; did we touch these?
  184.     jz    tuion05         ; no, just exit...
  185. ;
  186. ; restore each mixer setting                                           */
  187. ;
  188.         mov     cl,[LeftInputMixer]
  189.     mov    dx,BI_L_PCM
  190.     mov    bx,LeftInputChannel
  191.     inc    bx
  192.     call    dword ptr [MVSetMixerFunction]
  193.  
  194.         mov     cl,[RightInputMixer]
  195.     mov    dx,BI_R_PCM
  196.     mov    bx,RightInputChannel
  197.     inc    bx
  198.     call    dword ptr [MVSetMixerFunction]
  199. ;
  200. tuion05:
  201.     ret
  202.  
  203. TurnItOn    endp
  204.  
  205.  
  206. ;   /*\
  207. ;---|*| end of RECFILA.ASM
  208. ;   \*/
  209.  
  210.         end
  211.  
  212.